﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RESP_IIWaterAssessment
{
    public partial class ConflictForm : Form
    {


        int meetingID, avpID;
        InformationClass.ConflictObject ConObj;
        tb_conflict conflict;

        public ConflictForm(int meetingID, int avpID)
        {
            InitializeComponent();
            this.meetingID = meetingID;
            this.avpID = avpID;
            this.ShowInTaskbar = false;
        }

        public tb_conflict Conflict
        {
            get
            {
                return conflict;
            }
        }

        private void rbObjects_CheckedChanged(object sender, EventArgs e)
        {
            switch (((RadioButton)sender).Name)
            {
                case "rbAVPvsAVP":
                    ConObj = InformationClass.ConflictObject.AVPvsAVP;
                    break;
                case "rbAVPvsUIS":
                    ConObj = InformationClass.ConflictObject.AVPvsUIS;
                    break;
                case "rbAVPvsWU":
                    ConObj = InformationClass.ConflictObject.AVPvsWU;
                    break;
                case "rbWUvsWU":
                    ConObj = InformationClass.ConflictObject.WUvsWU;
                    break;
                default:
                    break;
            }

        }

        private void ConflictForm_Load(object sender, EventArgs e)
        {
            rbAVPvsUIS.Checked = true;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            conflict = new tb_conflict
            {
                ConflictType = (int)ConObj,
                IsInJournal = chbJournal.Checked,
                MeetingID = this.meetingID,
                AVPID = this.avpID,
                Result = rbPositive.Checked
            };
            this.Close();
        }
    }
}
